﻿using System.IO;
using UnityEngine;

    public class FileExtensions 
    {
        public static bool DeleteAllFile(string fullPath)
        {
            //获取指定路径下面的所有资源文件  然后进行删除
            if (Directory.Exists(fullPath))
            {
                DirectoryInfo direction = new DirectoryInfo(fullPath);
                FileInfo[] files = direction.GetFiles("*", SearchOption.AllDirectories);

//                Debug.Log(files.Length);

                for (int i = 0; i < files.Length; i++)
                {
                    if (files[i].Name.EndsWith(".meta"))
                    {
                        continue;
                    }
                    string FilePath = fullPath  + files[i].Name;
                //    Debug.Log(FilePath);
                    File.Delete(FilePath);
                }
                return true;
            }
            return false;
        }
    }